Shader "Custom RP/Lit" {
	
	Properties
	{
		_BaseMap("Texture", 2D) = "white" {} // 纹理
		_BaseColor("Color", Color) = (0.5, 0.5, 0.5, 1.0) // 获取颜色
		_Cutoff ("Alpha Cutoff", Range(0.0, 1.0)) = 0.5 // alpha裁剪
		[Toggle(_CLIPPING)] _Clipping ("Alpha Clipping", Float) = 0 // 开启alpha裁剪
		_Metallic ("Metallic", Range(0, 1)) = 0 // 金属感
		_Smoothness ("Smoothness", Range(0, 1)) = 0.5 // 表面光滑度
		[Toggle(_PREMULTIPLY_ALPHA)] _PremulAlpha ("Premultiply Alpha", Float) = 0 // 透明度影响漫反射
		[Enum(UnityEngine.Rendering.BlendMode)] _SrcBlend ("Src Blend", Float) = 1 // 源颜色的混合因子
		[Enum(UnityEngine.Rendering.BlendMode)] _DstBlend ("Dst Blend", Float) = 0 // 目标颜色的混合因子
		[Enum(Off, 0, On, 1)] _ZWrite ("Z Write", Float) = 1 // 开启深度写入
	}
	
	SubShader {
		
		Pass
		{
			Tags {
				"LightMode" = "CustomLit" // 使用自定义光照模式
			}
			
			Blend [_SrcBlend] [_DstBlend] // 启用透明度混合
			ZWrite [_ZWrite] // 设置深度写入
			
			HLSLPROGRAM
			#pragma target 3.5
			#pragma shader_feature _CLIPPING // 启用alpha裁剪
			#pragma shader_feature _PREMULTIPLY_ALPHA // 透明度影响漫反射
			#pragma multi_compile_instancing // GPU实例化
			#pragma vertex LitPassVertex // 顶点着色器
			#pragma fragment LitPassFragment // 片元着色器
			#include "LitPass.hlsl"
			ENDHLSL
		}
	}

	CustomEditor "CustomShaderGUI" // 自定义编辑器
}